import { ReactElement } from 'react'
import Sidebar from '@/components/Siderbar'
import AuthHeader from '@/components/AuthHeader'
import { locales } from '@/config'
import './style.css'

//generateStaticParams构建的时候就静态生成对应的语言的页面
export async function generateStaticParams() {
  return locales.map((lng) => ({ lng }))
}

export default async function RootLayout({
  children,
  params: {
    lng
  }
}: { children: ReactElement, params: any }) {

  return (
    <html lang={lng}>
      <body>
        <div className="container">
          <AuthHeader />
          <div className="main">
            <Sidebar />
            <section className="col note-viewer">{children}</section>
          </div>
        </div>
      </body>
    </html>
  )
}

